package com.top75;

import com.bean.ListNode;

/**
 * @Author: huangzhigao
 * @Date: 2023/5/22 20:20
 */
public class Code206 {
    public ListNode reverseList(ListNode head) {
        if (head == null) {
            return null;
        }
        ListNode prev = null;
        ListNode curr = head;
        while (curr != null) {
            ListNode next = curr.next;
            curr.next = prev;
            prev = curr;
            curr = next;

        }
        return prev;
    }
}
